package thread;

public class SyncDemo1 {
    public static boolean success1 = false;
    public static boolean success2 = false;
    public static void main(String[] args) {
        Bank bank = new Bank();
        Thread t1 = new Thread(){
            public void run(){
                success1 = bank.getMoney(20000);
            }
        };
        Thread t2 = new Thread(){
            public void run(){
                success2 = bank.getMoney(20000);
            }
        };
        t1.start();
        t2.start();
        try {
            Thread.sleep(5);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println(success1 + ":" + success2);
    }
}
